/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package snail.el;

import java.util.Collection;
import java.util.HashSet;
import snail.model.Article;
import snail.model.User;
import snail.model.UserRating;

/**
 *
 * @author Mickel
 */
public class SnailFunctions {

    public static boolean contains(Collection<?> collection, Object o) {
        if (o instanceof User) {
            int userId = ((User) o).getUserId();
            Collection<User> users = (Collection<User>) collection;
            for (User user : users) {
                if (user.getUserId() == userId) {
                    return true;
                }
            }
            return false;
        }
        return collection.contains(o);
    }
}
